Video encoding may include two processes, mode decision (including motion estimation) and bitstream packing (including frame reconstruction). These processes may be implemented in a pipelined fashion. The mode decision process may run on a programmable core, while bitstream packing may be implemented in hardware. Alternatively, these processes may run on an architecture that includes a central processing unit (CPU) that offloads some tasks to a graphics processing unit (GPU). For example, bitstream packing may run on a CPU while the mode decision may be executed on a GPU.
The interaction between the mode decision and bitstream packing operations includes interdependencies that may slow the encoding process. This two-stage pipelining may be picture-based, where an entire frame may be processed by the mode decision logic; the entire frame may then be processed by the bitstream packing logic. The bitstream packing logic may wait for the mode decision logic to finish processing the frame in order to access the motion vectors and additional information, such as macroblock modes, produced by the mode decision logic. The mode decision logic may wait for the completion of the bitstream packing logic as performed on the previous frame, because the mode decision logic may use the reconstructed frame as a reference for motion estimation (ME). These dependencies contribute to the time required for the video encoding process, and may therefore impact the user experience.
In the drawings, the leftmost digit(s) of a reference number identifies the drawing in which the reference number first appears.